﻿using LY.DataAccess.Repository;
using LY.Entity;
using LY.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LY.Business.ServiceImpl
{
    public class UserAddressService:IUserAddressService
    {
        private UserAddressRepository _userAddressRepository;
        public UserAddressService(UserAddressRepository userAddressRepository)
        {
            _userAddressRepository = userAddressRepository;
        }

        //获取默认地址
        public U_UserAddress GetDefaultAddress(int memberId)
        {
            return _userAddressRepository.GetDefaultAddress(memberId);
        }

        //获取用户的所有地址
        public List<U_UserAddress> QueryMemberAddresses(int memberId)
        {
            return _userAddressRepository.GetAllUserAddress(memberId);
        }

        //获取一个用户地址
        public U_UserAddress GetAddress(int Id)
        {
            return _userAddressRepository.GetAddress(Id);
        }
    }
}
